import PropTypes from 'prop-types'
import React, { memo } from 'react'
import { PlaceListWrapper } from './style'
import ScollView from '@/base-ui/scoll-view'
import PlaceItem from '@/components/place-item'

const PlaceList = memo(({placeList}) => {
  return (
    <PlaceListWrapper>
       <div className='place-list'>
            <ScollView>
                {
                    placeList?.map((place, index) => (
                        <PlaceItem key={index} place={place} width="20%"/>
                    ))
                }
            </ScollView>
        </div>
    </PlaceListWrapper>
  )
})

PlaceList.propTypes = {
    placeList: PropTypes.array
}

export default PlaceList